<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="../../../common/common-jstl.jspf" %>
<%@ include file="../../../common/common-easyui.jspf" %>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>重新批改试卷</title>
</head>
<body>
<style type="text/css">
    .question {
        background-color: #ccc;
        width: 100%;
        height: 20px;
    }

    .stuAnswer, .answer {
        width: 100%;
        height: 120px;

    }

    .stu {
        width: 100%;
        height: 73px;
        background-color: #ccc;
    }

    .an {
        width: 100%;
        height: 100px;
    }

    form {
        width: 100%;
    }
</style>
<form id="frm" action="" method="post">
    <c:forEach items="${subAnswerList }" var="subAnswer" varStatus="st">
        <div style="margin: 0 atuo;width: 500px;height: 260px;border: 1px solid #ccc;">
            <div class="question" style="height: 20px;">${st.count }、${subAnswer.question } ${subAnswer.score }分</div>
            <hr/>
            <div class="stuAnswer">
                <div>学生答案：</div>
                <div class="stu">${subAnswer.stuAnswer }</div>
                得分：<input style="height: 20px;" type="text" value="${subAnswer.subScore }" name="subScore">
            </div>
            <br/>
            <hr/>
            <div class="answer">
                <div style="height: 20px;">参考答案：</div>
                <div class="an">${subAnswer.answer }</div>
            </div>
        </div>
        <br/>
    </c:forEach>
    <div style="text-align: center;margin-bottom: 20px;">
        <a href="javascript:;" id="subFrm" onclick="submitForm('${paperId }','${stuId }');" class="easyui-linkbutton">提交试卷</a>
    </div>
</form>
<script type="text/javascript">
    // 提交表单
    function submitForm(paperId, stuId) {

        $("#frm").form('submit', {
            url: 'checkSubjectiveController?flag=check&paperId=' + paperId + '&stuId=' + stuId,
            success: function (data) {
                if (data == "ok") {
                    alert("提交成功");
                } else {
                    alert("提交失败");
                }
            }
        });
    }

</script>
</body>
</html>